#!/usr/bin/env python3.0

import curses
import readline

def main():
	# initialize curses.
	stdscr = curses.initscr()
	curses.cbreak()
	curses.noecho()
	stdscr.keypad(True)

	height = curses.LINES;
	width = curses.COLS;

	# it cannot receive multibyte characters.
	win = curses.newwin(height//4,width//2,5,10)
	win.box()
	win.refresh()

	while True:
		ch = win.getch()
		if ch==ord('\n'):
			break
		win.addch(ch)

	curses.def_prog_mode()

	curses.endwin()
	str = input("input> ")

	win.refresh()
	win.addstr(1,1, str)
	win.move(2,1)

	while True:
		ch = win.getch()
		if ch==ord('\n'):
			break
		win.addch(ch)

	
	curses.endwin()
	print(str)

main()



